﻿using System.Windows.Controls;
using System.Windows.Input;
using CPETwit.WPFClient.Common;

namespace CPETwit.WPFClient.UC
{
    /// <summary>
    /// Logique d'interaction pour Header.xaml
    /// </summary>
    public partial class Header : UserControl
    {
        public Header()
        {
            InitializeComponent();
        }

        private void CustomTextBox_KeyDown(object sender, KeyEventArgs e)
        {
            TextBox textBox = sender as TextBox;
            if(textBox == null) return;
            if(e.Key == Key.Enter && string.IsNullOrEmpty(textBox.Text)==false)
            {
                DialogManager.ShowTweetResearch(textBox.Text);
                textBox.Text = string.Empty;
            }
        }
    }
}
